package com.util;

import java.io.Serializable;

public class JsonResult<E> implements Serializable {
    private Integer state;//响应状态码
    private String message;//描述
    private E data;
    public static final int OK = 200;
    public String token;
    public JsonResult() {
    }

    public JsonResult(Integer state) {
        this.state = state;
    }

    public JsonResult(Throwable e) {
        this.message = e.getMessage();
    }

    public JsonResult(Integer state, E data) {
        this.state = state;
        this.data = data;
    }

    public JsonResult(String token){
        this.token = token;
    }

    public Integer getState() {
        return state;
    }

    public String getToken() {
        return token;
    }

    public void setToken(String token) {
        this.token = token;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public E getData() {
        return data;
    }

    public void setData(E data) {
        this.data = data;

    }
}

